package reflect;


import java.util.Scanner;

public class ReflectDemo2
{
    public static void main(String[] args) throws InstantiationException, IllegalAccessException, ClassNotFoundException
    {
        test();
        Scanner scanner = new Scanner(System.in);
        Class person = Class.forName(scanner.nextLine());
        Object o = person.newInstance();
        System.out.println(o);
    }


    public static  void test() throws InstantiationException, IllegalAccessException
    {
        Person person = new Person();
        Class aClass = person.getClass();
        Person p1 = (Person) aClass.newInstance();
        System.out.println(p1.toString());

    }

}
